#!/bin/bash

# 设置工作目录
cd /home/loongson/Seekfree_LS2K0300_Opensource_Library/project/user/build

# 设置环境变量
export PATH=$PATH:/home/loongson/Seekfree_LS2K0300_Opensource_Library/project/user/build

# 启动程序
sudo -E ./project

# 如果程序崩溃，等待3秒后重启
while true; do
    if ! pgrep -f "project" > /dev/null; then
        sleep 3
        sudo -E ./project
    fi
    sleep 1
done 